<template>
	<div id="app">
		<router-view />
	</div>
</template>

<script>
	export default {
		name: 'App',
		mounted(){
		    function checkIE(){
		      return '-ms-scroll-limit' in document.documentElement.style && '-ms-ime-align' in document.documentElement.style
		    }
		    if (checkIE()) {
		      window.addEventListener('hashchange', () => {
		        var currentPath = window.location.hash.slice(1);
		        if (this.$route.path !== currentPath) {
		        this.$router.push(currentPath)
		      }
		    }, false)
		    }
		  },
		  beforeCreate(){
      let count = 0;
      let imgs = [
        //用require的方式添加图片地址，直接添加图片地址的话，在build打包之后会查找不到图片，因为打包之后的图片名称会有一个加密的字符串
        require('./assets/liucheng1.jpg'),
		    require('./assets/liucheng2.jpg'),
		    require('./assets/1.png'),
		    require('./assets/2.png'),
		    require('./assets/3.png'),
		    require('./assets/21.png'),
      ]
      for (let img of imgs) {
        let image = new Image();
        image.src = img;
        image.onload = () => {
          count++;
        };
      }
    },

	}
</script>

<style lang="stylus">
	@import './public/App.styl';
</style>
